package main

import (
	"itam/internal/logic/vm"
	_ "itam/internal/packed"

	"github.com/gogf/gf/v2/os/gcron"
	"github.com/gogf/gf/v2/os/gctx"

	"itam/internal/cmd"

	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"

	_ "itam/internal/logic"

	_ "github.com/gogf/gf/v2/frame/g"
	_ "github.com/gogf/gf/v2/os/gcron"
	_ "github.com/gogf/gf/v2/os/gctx"
)

func main() {
	webCtx := gctx.New()
	jobCtx := gctx.New()
	// 扫描虚拟机状态,每小时跑一次
	// vm.CheckStatus(jobCtx)
	_, err := gcron.Add(jobCtx, "0 0 * * * *", vm.CheckStatus, "CheckVMStatus")
	if err != nil {
		panic(err)
	}
	cmd.Main.Run(webCtx)

}
